//part1:C01:ex1.16.cpp -- read some integers, calculate sum of them.
#include <iostream>

int main(void)
{
    int sum = 0, val = 0;
    std::cout << "Enter some integers, Ctrl + Z to quit"
        << std::endl;
    for (; std::cin >> val;) 
    {
        sum += val;
    }
    std::cout << "sum of integers is :" <<
        sum << std::endl;
    return 0;
}
